﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/Master.Master" AutoEventWireup="true"
    CodeBehind="wFrmSituacionArticulo.aspx.cs" Inherits="Crosland.Automotriz.Web.Repuestos.wFrmSituacionArticulo" %>

<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxImageGallery" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxTabControl" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxRoundPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPopupControl" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"    Namespace="DevExpress.Web.ASPxClasses" TagPrefix="dx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphMain" runat="server">
    <script type="text/javascript">


        function pageLoad() {

            var control = document.getElementById('ctl00_cphMain_hfIndicador');
            cambiarImagenHeader();

            if (control.value == 'S') {
                $find('<%= ((AjaxControlToolkit.CollapsiblePanelExtender)this.Master.FindControl("cpeMenuGeneral")).BehaviorID %>')._doClose();

                control.value = 'N';
            }


        }

                

                
               

    </script>
    <div class="main-header" style="width: 100%">
        <div class="main-titulo" style="width: 87%;">
            Situación de Artículos
        </div>
        <table>
            <tr>
                <td>
                    <dx:ASPxButton ID="btnSalir" runat="server" Text="Salir" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                        CssPostfix="Office2010Blue" Height="10px" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                        Width="10px" OnClick="btnSalir_Click">
                    </dx:ASPxButton>
                </td>
            </tr>
        </table>
    </div>
    <div>
        <asp:HiddenField ID="hfIndicador" runat="server" Value="S" />
        <dx:ASPxRoundPanel ID="rpFiltroSituacionArticulo" runat="server" Width="200px" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
            CssPostfix="Office2010Blue" EnableDefaultAppearance="False" GroupBoxCaptionOffsetX="0px"
            GroupBoxCaptionOffsetY="0px" HeaderText="" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
            ShowHeader="False">
            <ContentPaddings PaddingBottom="0px" PaddingLeft="0px" PaddingRight="0px" PaddingTop="0px" />
            <HeaderStyle>
                <Paddings PaddingBottom="6px" PaddingLeft="9px" PaddingRight="11px" PaddingTop="3px" />
            </HeaderStyle>
            <PanelCollection>
                <dx:PanelContent runat="server" SupportsDisabledAttribute="True">
                    <table>
                        <tr>
                            <td>
                                <dx:ASPxLabel ID="ASPxLabel1" runat="server" Text="Código" Font-Names="Arial Black"
                                    Font-Size="9pt">
                                </dx:ASPxLabel>
                            </td>
                            <td>
                                <dx:ASPxTextBox ID="txtBuscarCodigo" runat="server" Width="150px" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                    CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                    <Paddings Padding="4px" />
                                    <ValidationSettings ErrorText="Valor inv&#225;lido">
                                        <RegularExpression ErrorText="Fall&#243; la validaci&#243;n de expresi&#243;n Regular">
                                        </RegularExpression>
                                    </ValidationSettings>
                                </dx:ASPxTextBox>
                            </td>
                            <td>
                                <dx:ASPxLabel ID="ASPxLabel2" runat="server" Text="Descripción:" Font-Names="Arial Black"
                                    Font-Size="10pt">
                                </dx:ASPxLabel>
                            </td>
                            <td>
                                <dx:ASPxTextBox ID="txtDescripcion" runat="server" Width="400px" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                    CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                    ClientEnabled="False" BackColor="#F8F8F8" Cursor="pointer" Enabled="False" ForeColor="#333333">
                                    <Paddings Padding="4px" />
                                    <ValidationSettings ErrorText="Valor inv&#225;lido">
                                        <RegularExpression ErrorText="Fall&#243; la validaci&#243;n de expresi&#243;n Regular">
                                        </RegularExpression>
                                    </ValidationSettings>
                                </dx:ASPxTextBox>
                            </td>
                            <td class="filas2">
                                <dx:ASPxButton ID="btnAbrirPopup" runat="server" Text="..." CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                    CssPostfix="Office2010Blue" HorizontalAlign="Center" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                    VerticalAlign="Top" AutoPostBack="False">
                                    <ClientSideEvents Click="function(s, e) {
	PopupBuscarArticulos.Show();
}" />
                                </dx:ASPxButton>
                            </td>
                            <td>
                                <dx:ASPxButton ID="btnConsultar" runat="server" Text="Consultar" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                    CssPostfix="Office2010Blue" OnClick="btnBuscarCodigo_Click" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                    Width="100px">
                                    <Image Url="~/Images/search.png">
                                    </Image>
                                    <Paddings Padding="4px" />
                                </dx:ASPxButton>
                            </td>
                        </tr>
                    </table>
                </dx:PanelContent>
            </PanelCollection>
        </dx:ASPxRoundPanel>
        <div class="filas2" style="width: 100%;">
            <dx:ASPxPageControl ID="TabSituacionArticulos" runat="server" RenderMode="Lightweight"
                ActiveTabIndex="0" Theme="MetropolisBlue" Width="100%" Visible="False" 
                ontabclick="TabSituacionArticulos_TabClick">
                <TabPages>
                    <dx:TabPage Text="Datos">
                        <ContentCollection>
                            <dx:ContentControl runat="server" SupportsDisabledAttribute="True">
                                <div class="content-report" style="height: 100%">
                                    <rsweb:ReportViewer ID="ReportViewerSituacionArticulo" runat="server" Width="100%"
                                        Height="500px" ShowParameterPrompts="False">
                                    </rsweb:ReportViewer>
                                </div>
                            </dx:ContentControl>
                        </ContentCollection>
                    </dx:TabPage>
                    <dx:TabPage Text="Fotos">
                        <ContentCollection>
                            <dx:ContentControl runat="server" SupportsDisabledAttribute="True">
                                <dx:ASPxImageGallery ID="ImgGaleriaSlider" runat="server" OnCustomImageProcessing="ImgGaleriaSlider_CustomImageProcessing"
                                    ThumbnailHeight="" ThumbnailWidth="" Theme="MetropolisBlue" Width="100%">
                                    <SettingsTableLayout ColumnCount="5" />
                                    <PagerSettings Position="Bottom">
                                        <PageSizeItemSettings Visible="True">
                                        </PageSizeItemSettings>
                                    </PagerSettings>
                                </dx:ASPxImageGallery>
                            </dx:ContentControl>
                        </ContentCollection>
                    </dx:TabPage>
                </TabPages>
            </dx:ASPxPageControl>
        </div>
        <div>
            <asp:TextBox ID="txtIdMaterial" runat="server" Visible="False"></asp:TextBox>
        </div>
        <div>
            <dx:ASPxPopupControl ID="PopupBuscarArticulos" runat="server" Width="733px" CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css"
                CssPostfix="PlasticBlue" EnableViewState="False" HeaderText="Buscar Articulos"
                LoadingPanelText="Cargando&amp;hellip;" PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter"
                SpriteCssFilePath="~/App_Themes/PlasticBlue/{0}/sprite.css" AllowDragging="True"
                CloseAction="CloseButton" Modal="True" ClientInstanceName="PopupBuscarArticulos"
                Theme="Office2010Blue">
                <LoadingPanelImage Url="~/App_Themes/PlasticBlue/Web/dvLoading.gif">
                </LoadingPanelImage>
                <CloseButtonStyle>
                    <Paddings Padding="0px" />
                </CloseButtonStyle>
                <ContentStyle>
                    <BorderBottom BorderColor="#E0E0E0" BorderStyle="Solid" BorderWidth="1px" />
                </ContentStyle>
                <HeaderStyle>
                    <Paddings PaddingLeft="10px" PaddingBottom="4px" PaddingRight="4px" PaddingTop="4px" />
                </HeaderStyle>
                <ContentCollection>
                    <dx:PopupControlContentControl runat="server" SupportsDisabledAttribute="True">
                        <dx:ASPxPanel ID="Panel2" runat="server" DefaultButton="btCreate">
                            <PanelCollection>
                                <dx:PanelContent runat="server">
                                    <table cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td class="filas2">
                                                <dx:ASPxTextBox ID="txtBuscar" runat="server" Width="308px" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                                    CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                                    NullText="Ingrese (Código,Descripción o Modelo)">
                                                    <Paddings Padding="5px" />
                                                    <ValidationSettings>
                                                        <RegularExpression ErrorText="Falló la validación de expresión Regular" />
                                                    </ValidationSettings>
                                                </dx:ASPxTextBox>
                                            </td>
                                            <td class="filas2">
                                                <dx:ASPxButton ID="btnBuscarPopup" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                                    CssPostfix="Office2010Blue" OnClick="btnBuscarPopup_Click" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                                    Text="Buscar" AutoPostBack="False">
                                                    <Image Url="~/Images/search.png">
                                                    </Image>
                                                    <Paddings Padding="5px" />
                                                </dx:ASPxButton>
                                            </td>
                                            <td>
                                                &nbsp;
                                            </td>
                                            <td>
                                                &nbsp;
                                            </td>
                                            <td class="filas2">
                                                Mostrar los primeros&nbsp;&nbsp;
                                            </td>
                                            <td class="filas2">
                                                <dx:ASPxComboBox ID="cboopcion" runat="server" SelectedIndex="2" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                                    CssPostfix="Office2010Blue" Spacing="0" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                                    Width="50px">
                                                    <Items>
                                                        <dx:ListEditItem Text="100" Value="100" />
                                                        <dx:ListEditItem Text="200" Value="200" />
                                                        <dx:ListEditItem Selected="True" Text="500" Value="500" />
                                                    </Items>
                                                    <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Editors/Loading.gif">
                                                    </LoadingPanelImage>
                                                    <LoadingPanelStyle ImageSpacing="5px">
                                                    </LoadingPanelStyle>
                                                    <Paddings Padding="4px" />
                                                    <ValidationSettings>
                                                        <RegularExpression ErrorText="Falló la validación de expresión Regular" />
                                                    </ValidationSettings>
                                                </dx:ASPxComboBox>
                                            </td>
                                            <td class="filas2">
                                                Registros
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="filas2" align="right" bgcolor="White">
                                                <dx:ASPxLabel ID="ASPxLabel3" runat="server" BackColor="White" Font-Names="Calibri"
                                                    Font-Size="13pt" ForeColor="#3366CC" RightToLeft="False" Text="Stock actualizado al :">
                                                </dx:ASPxLabel>
                                            </td>
                                            <td class="filas2" colspan="6" bgcolor="White">
                                                <dx:ASPxLabel ID="lblStockActualizado" runat="server" BackColor="White" Font-Names="Calibri"
                                                    Font-Size="12pt" ForeColor="#3366CC">
                                                </dx:ASPxLabel>
                                            </td>
                                        </tr>
                                    </table>
                                    <dx:ASPxGridView ID="grdArticulos" runat="server" AutoGenerateColumns="False" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                        CssPostfix="Office2010Blue" KeyFieldName="COD_MATERIAL" Width="801px" OnAfterPerformCallback="grdArticulos_AfterPerformCallback"
                                        OnPageIndexChanged="grdArticulos_PageIndexChanged">
                                        <Columns>
                                            <dx:GridViewDataTextColumn Caption="Código" FieldName="COD_MATERIAL" ShowInCustomizationForm="True"
                                                VisibleIndex="1" ToolTip="Codigo material" Width="150px">
                                                <PropertiesTextEdit>
                                                    <ValidationSettings ErrorText="Valor inválido">
                                                        <RegularExpression ErrorText="Falló la validación de expresión Regular" />
                                                    </ValidationSettings>
                                                </PropertiesTextEdit>
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="Descripción" FieldName="DES_MATERIAL" ShowInCustomizationForm="True"
                                                VisibleIndex="2" ToolTip="Descripción material" Width="350px">
                                                <PropertiesTextEdit>
                                                    <ValidationSettings ErrorText="Valor inválido">
                                                        <RegularExpression ErrorText="Falló la validación de expresión Regular" />
                                                    </ValidationSettings>
                                                </PropertiesTextEdit>
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="Modelo" FieldName="DES_MODELO" ShowInCustomizationForm="True"
                                                VisibleIndex="3" Width="200px">
                                                <PropertiesTextEdit>
                                                    <ValidationSettings ErrorText="Valor inválido">
                                                        <RegularExpression ErrorText="Falló la validación de expresión Regular" />
                                                    </ValidationSettings>
                                                </PropertiesTextEdit>
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn FieldName="ID_MATERIAL" ShowInCustomizationForm="True"
                                                Visible="False" VisibleIndex="0">
                                                <PropertiesTextEdit>
                                                    <ValidationSettings ErrorText="Valor inválido">
                                                        <RegularExpression ErrorText="Falló la validación de expresión Regular" />
                                                    </ValidationSettings>
                                                </PropertiesTextEdit>
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="Alm. Gral." FieldName="ALMACEN_GENERAL" ShowInCustomizationForm="True"
                                                VisibleIndex="5" Width="100px">
                                                <PropertiesTextEdit DisplayFormatString="{0:#,##0}">
                                                </PropertiesTextEdit>
                                                <HeaderStyle HorizontalAlign="Center" />
                                                <CellStyle HorizontalAlign="Center">
                                                </CellStyle>
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="Alm. C" FieldName="ALMACEN_C" ShowInCustomizationForm="True"
                                                VisibleIndex="7" Width="100px">
                                                <PropertiesTextEdit DisplayFormatString="{0:#,##0}">
                                                </PropertiesTextEdit>
                                                <HeaderStyle HorizontalAlign="Center" />
                                                <CellStyle HorizontalAlign="Center">
                                                </CellStyle>
                                            </dx:GridViewDataTextColumn>
                                        </Columns>
                                        <SettingsBehavior AllowFocusedRow="True" />
                                        <SettingsPager PageSize="200">
                                            <AllButton Text="All">
                                            </AllButton>
                                            <NextPageButton Text="Next &gt;">
                                            </NextPageButton>
                                            <PrevPageButton Text="&lt; Prev">
                                            </PrevPageButton>
                                        </SettingsPager>
                                        <Settings ShowVerticalScrollBar="True" />
                                        <SettingsLoadingPanel Text="Cargando&amp;hellip;" />
                                        <Images SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                            <LoadingPanelOnStatusBar Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                                            </LoadingPanelOnStatusBar>
                                            <LoadingPanel Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                                            </LoadingPanel>
                                        </Images>
                                        <ImagesFilterControl>
                                            <LoadingPanel Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                                            </LoadingPanel>
                                        </ImagesFilterControl>
                                        <Styles CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue">
                                            <Header ImageSpacing="5px" SortingImageSpacing="5px">
                                            </Header>
                                            <LoadingPanel ImageSpacing="5px">
                                            </LoadingPanel>
                                        </Styles>
                                        <StylesPager>
                                            <PageNumber ForeColor="#3E4846">
                                            </PageNumber>
                                            <Summary ForeColor="#1E395B">
                                            </Summary>
                                        </StylesPager>
                                        <StylesEditors ButtonEditCellSpacing="0">
                                            <ProgressBar Height="21px">
                                            </ProgressBar>
                                        </StylesEditors>
                                    </dx:ASPxGridView>
                                    <br />
                                    <table cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td>
                                                <dx:ASPxButton ID="btnaceptar" runat="server" Text="Aceptar" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                                    CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                                    OnClick="btnaceptar_Click" AutoPostBack="False">
                                                </dx:ASPxButton>
                                            </td>
                                            <td>
                                            </td>
                                            <td>
                                                <dx:ASPxButton ID="btncancelar" runat="server" AutoPostBack="False" Text="Cancelar"
                                                    CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue"
                                                    SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                                    <ClientSideEvents Click="function(s, e) {
	PopupBuscarArticulos.Hide();
}" />
                                                </dx:ASPxButton>
                                            </td>
                                        </tr>
                                    </table>
                                </dx:PanelContent>
                            </PanelCollection>
                        </dx:ASPxPanel>
                    </dx:PopupControlContentControl>
                </ContentCollection>
            </dx:ASPxPopupControl>
        </div>
    </div>
    <div>
        <dx:ASPxPopupControl ID="popupmsj" runat="server" AllowDragging="True" ClientInstanceName="popupmsj"
            CloseAction="CloseButton" CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css"
            CssPostfix="PlasticBlue" EnableViewState="False" HeaderText="Mensaje" LoadingPanelText="Cargando&amp;hellip;"
            Modal="True" PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter"
            SpriteCssFilePath="~/App_Themes/PlasticBlue/{0}/sprite.css" Width="300px">
            <LoadingPanelImage Url="~/App_Themes/PlasticBlue/Web/dvLoading.gif">
            </LoadingPanelImage>
            <CloseButtonStyle>
                <Paddings Padding="0px" />
            </CloseButtonStyle>
            <ContentStyle>
                <BorderBottom BorderColor="#E0E0E0" BorderStyle="Solid" BorderWidth="1px" />
            </ContentStyle>
            <HeaderStyle>
                <Paddings PaddingBottom="4px" PaddingLeft="10px" PaddingRight="4px" PaddingTop="4px" />
            </HeaderStyle>
            <ContentCollection>
                <dx:PopupControlContentControl ID="PopupControlContentControl5" runat="server" SupportsDisabledAttribute="True">
                    <br />
                    <dx:ASPxPanel ID="ASPxPanel2" runat="server" DefaultButton="btCreate">
                        <PanelCollection>
                            <dx:PanelContent ID="Panelpopup" runat="server">
                                <table style="width: 100%;">
                                    <tr>
                                        <td style="width: 100%;" align="center">
                                            <asp:Label ID="lblMsj" runat="server"></asp:Label>
                                        </td>
                                    </tr>
                                </table>
                                <table style="width: 100%;">
                                    <tr>
                                        <td style="width: 100%;" align="center">
                                            <dx:ASPxButton ID="ASPxButton1" runat="server" Text="Aceptar" AutoPostBack="False"
                                                CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue"
                                                SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" Width="10px">
                                                <ClientSideEvents Click="function(s, e) {
	popupmsj.Hide();
}" />
                                            </dx:ASPxButton>
                                        </td>
                                    </tr>
                                </table>
                            </dx:PanelContent>
                        </PanelCollection>
                    </dx:ASPxPanel>
                </dx:PopupControlContentControl>
            </ContentCollection>
        </dx:ASPxPopupControl>
    </div>
</asp:Content>
